package com.example.a84416.shiyan2;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

public class UC1 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_uc1);
        Button btn1=(Button)findViewById(R.id.exit);
        btn1.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        Button btn2 = (Button) findViewById(R.id.HorizentaLayout);
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                LinearLayout l=findViewById(R.id.linerlayout);
                l.setOrientation(LinearLayout.HORIZONTAL);
            }
        });
        Button btn3 = (Button) findViewById(R.id.Vertical_aligned);
        btn3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                LinearLayout l=findViewById(R.id.linerlayout);
                l.setOrientation(LinearLayout.VERTICAL);
            }
        });
        Button btn4 = (Button) findViewById(R.id.Left_aligned);
        btn4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                LinearLayout l = findViewById(R.id.linerlayout);
                l.setLeft(0);
            }
        });

}
}